//index.js
//获取应用实例
const app = getApp()
import {
  classificationList
} from '../../utils/data.js'
Page({
  data: {
    swiperList: [
      'https://img.pic88.com/preview/2020/09/02/1599057274775895.jpg?imageMogr2/auto-orient/strip/gravity/Center/thumbnail/!468x280.8r/crop/390x234/format/jpg/interlace/1/sharpen/1/quality/100',
      'https://img.pic88.com/preview/2020/09/03/159910221694271.jpg?imageMogr2/auto-orient/strip/gravity/Center/thumbnail/!468x280.8r/crop/390x234/format/jpg/interlace/1/sharpen/1/quality/100',
      'https://img.pic88.com/preview/2020/09/03/159910225493987.jpg?imageMogr2/auto-orient/strip/gravity/Center/thumbnail/!468x280.8r/crop/390x234/format/jpg/interlace/1/sharpen/1/quality/100'
    ],
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    productList: classificationList,
    hotList: [{
        did: 1,
        title: "今日热卖",
        cover: "https://img.pic88.com/preview/2020/08/05/15966421681394087.jpg!s640"
      },
      {
        did: 2,
        title: "今日热卖",
        cover: "https://img.pic88.com/preview/2020/08/05/15966422201393582.jpg!s640"
      },
    ],
  },
  onLoad: function () {

  },
  onShow:function(){
    console.log(wx.$post)
    this.getBanner()
  },
  getBanner(){
    wx.$post("banner/list").then(res=>{
      const {data} = res
      this.setData({
        swiperList:data.data
      })
    })
  }

})